package com.huoyun.base.dao;

import java.util.List;

import com.huoyun.base.bean.Region;

public class RegionDaoImpl extends BaseDaoImpl<Region> implements RegionDao {

	@Override
	public Region getRegionByCode(String code) {
		return sqlSessionTemplate.selectOne("com.huoyun.base.dao.RegionDaoMapper.getRegionByCode", code);
	}
	
	@Override
	public Region getRegionById(int id)
	{
		return sqlSessionTemplate.selectOne("com.huoyun.base.dao.RegionDaoMapper.getRegionById", id);
	}

	@Override
	public List<Region> queryChilds(int parentId) {
		return sqlSessionTemplate.selectList("com.huoyun.base.dao.RegionDaoMapper.queryChilds", parentId);
	}
	
	@Override
	public List<Region> queryChilds(String parentCode)
	{
		return sqlSessionTemplate.selectList("com.huoyun.base.dao.RegionDaoMapper.queryChildsByParentCode", parentCode);
	}
	
	@Override
	public List<Region> queryHotCitys()
	{
		return sqlSessionTemplate.selectList("com.huoyun.base.dao.RegionDaoMapper.queryHotCitys");
	}

}
